import { defineStore } from "pinia";
import type { StoreDefinition } from "pinia";

type SystemStoreState = {
	address: string;
};

export const useUserAddress: StoreDefinition<string, SystemStoreState> = defineStore<string, SystemStoreState>(
	"userAddress",
	{
		state: (): SystemStoreState => ({
			address: "福进驾校 [古浪路店]"
		}),

		actions: {
			/**
			 * @description 更新语言
			 * */
			updateUserAddress(value: string) {
				this.address = value;
			}
		},

		getters: {
			getUserAddress(state) {
				return state.address;
			}
		}
	}
);
